<style lang="less">
	/*@import './international.less';*/
</style>

<template>
	<div>
		<common-page v-bind="menuPage">
			<template slot="modal">
				<Form :model="menuPage.detailData" :label-width="80">
					<FormItem label="ID">
						<Input v-model="menuPage.detailData.id"></Input>
					</FormItem>
					<FormItem label="用户名">
						<Input v-model="menuPage.detailData.username"></Input>
					</FormItem>
					<FormItem label="密码">
						<Input v-model="menuPage.detailData.password"></Input>
					</FormItem>
					<FormItem label="邮箱">
						<Input v-model="menuPage.detailData.email"></Input>
					</FormItem>
					<FormItem label="状态">
						<Input v-model="menuPage.detailData.state"></Input>
					</FormItem>
				</Form>
			</template>
		</common-page>
	</div>
</template>

<script>

    import commonPage from '@/views/common/common-page.vue';
    import util from '@/libs/util';
    import autoSelect from '@/views/common/autoSelect.vue';

    // 默认界面查询条件
    let pageParams = Object.assign({}, util.queryParams, { // 额外的参数,比如条件的默认值
        sortName: "id",
        sortOrder: "asc"
    });
    export default {
        name: 'test-page',
        components: {
            commonPage
        },
        props: {
            columns: Array
        },
        data () {
            return {
                menuPage: {
                    toolbar: {
                        menuSn: "test",
                        buttons: []
                    },
                    list: {
                        table: {
                            columns: [
                                {type: 'selection', width: 50, align: 'center'},
                                {type: 'index', width: 60, align: 'center'},
                                {title: 'ID', key: 'id'},
                                {title: '用户名', key: 'username'},
                                {title: '密码', key: 'password'},
                                {title: '邮箱', key: 'email'},
                                {title: '状态', key: 'state'}
                            ],
                            data: []
                        },
                        url: "test/list",
                        queryParams: pageParams
                    },
                    searchbar: {
                        queryParams: pageParams,
                        inputs: [
                            {
                                text: "ID",
                                sn: "id",
                                style: {
                                    width: "200px"
                                }
                            },
                            {
                                text: "用户名",
                                sn: "username",
                                style: {
                                    width: "200px"
                                }
                            },
                            {
                                text: "密码",
                                sn: "password",
                                style: {
                                    width: "200px"
                                }
                            },
                            {
                                text: "邮箱",
                                sn: "email",
                                style: {
                                    width: "200px"
                                }
                            },
                            {
                                text: "状态",
                                sn: "state",
                                style: {
                                    width: "200px"
                                }
                            }
                        ]
                    },
                    pageParams: pageParams,
                    detailData: {
                        id: "",
                        username: "",
                        password: "",
                        email: "",
                        state: ""
                    }
                }
            };
        },
        methods: {},
        created () {
        },
        mounted() {
        }
    };
</script>
